package interfaces;

public interface Minesweepable {

	/**
	 * Returns the selected filled square number from the data source on the given position.
	 * @param row - Position's row
	 * @param column  - Position's column
	 * @return the square number -> if is == -1 there is a mine, else returns the number of surrounding mines
	 */
	int getSquare(int row, int column);
	
	/**
	 * Opens a square on given position.
	 * The minesweeper is designed to open squares with ripple effect.
	 * @param row - Position's row
	 * @param column  - Position's column
	 */
	void openSquare(int row, int column);
	
	/**
	 * Checks if the square on given position is opened.
	 * @param row - Position's row
	 * @param column  - Position's column
	 * @return is the square already opened.
	 */
	boolean isOpened(int row, int column);
	
	/**
	 * Changes the flag state on square on given position.
	 * @param row - Position's row
	 * @param column  - Position's column
	 * @return if the player has flags left to play with.
	 */
	boolean changeFlagSquareState(int row, int col);
	
	/**
	 * Checks if the square on the given position is saved with a flag.
	 * @param row - Position's row
	 * @param column  - Position's column
	 * @return is the square having flag.
	 */
	boolean isFlagged(int row, int col);
	
	/**
	 * Checks if the minesweeper game is win.
	 * @return is the game over.
	 */
	boolean isGameWon();
	
	/**
	 * Returns the number of flags left in a Player's disposal.
	 * @return number of mines left to play with
	 */
	int getNumberOfFlagsLeft();
}
